<template>
  <div id="pie" ref="pieChart"></div>
</template>

<script>
export default {
  name: "pieChart",
  props: {},
  components: {},
  data() {
    return {};
  },
  computed: {},
  mounted() {
    this.myChart = this.$echarts.init(this.$refs.pieChart);
    this.initOption();
  },
  methods: {
    initOption() {
      this.option = {
        title: {
          text: "本月各级别安全事件发布情况",
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "horizontal",
          bottom: "10",
        },
        series: [
          {
            name: "访问来源",
            type: "pie",
            radius: "50%",
            data: [
              { value: 1048, name: "一般严重" },
              { value: 735, name: "严重事件" },
              { value: 580, name: "特别严重事件" },
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
          },
        ],
      };
      this.myChart.setOption(this.option);
    },
  },
  watch: {},
};
</script>
<style lang="scss" scoped>
//@import url(); 引入公共css类
</style>
